import { useHistory } from 'react-router-dom'
import { TStata } from './types/data'

export default function Home() {
  const history = useHistory<TStata>()
  const handleClick = () => {
    history.push({
      pathname: '/login',
      state: {
        // 第一个问题：from 没有提示和类型校验
        // from: 'home',
        from: 'home',
      },
    })
  }
  return (
    <div>
      <h3>Home</h3>
      <button onClick={handleClick}>登录页</button>
    </div>
  )
}
